package com.xuecheng.system.controller;
/*
*
*
* 用户登录
* 请求的参数，封装的对象  dto
* 响应的数据  封装的对象  vo
*
* */

import com.xuecheng.commons.model.dto.LoginDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.system.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class LoginController {
    @Autowired
    private UserService userService;

    /*
     * 接口路径post/login
     * */
    @PostMapping("/login")
    public ResponseResult login(@RequestBody LoginDto dto) {
        return userService.login(dto);
    }

}
